import request from '@/utils/request'


// 通过状态查询教师接单列表
export function listSquareByStatus(query) {
  return request({
    url: '/square/square/listSquareByStatus',
    method: 'get',
    params: query
  })
}

// 通过家长名查询家长发布列表
export function listSquareByParent(params) {
  return request({
    url: '/square/square/listSquareByParent',
    method: 'get',
    params: params // 传递parentName和status
  })
}
// 通过教员名查询教师接单列表
export function listSquareByTeacher(params) {
  return request({
    url: '/square/square/listSquareByTeacher',
    method: 'get',
    params: params // 可选：传递其他参数如分页
  })
}


export function listSquareByUserName(params) {
  return request({
    url: '/square/square/listSquareByUserName/' + params.userName,
    method: 'get',
    params: params // 可选：传递其他参数如分页
  })
}

// 查询家教广场列表
export function listSquare(query) {
  return request({
    url: '/square/square/list',
    method: 'get',
    params: query
  })
}



// 查询家教广场详细
export function getSquare(requestId) {
  return request({
    url: '/square/square/' + requestId,
    method: 'get'
  })
}

// 新增家教广场
export function addSquare(data) {
  return request({
    url: '/square/square',
    method: 'post',
    data: data
  })
}

// 修改家教广场
export function updateSquare(data) {
  return request({
    url: '/square/square',
    method: 'put',
    data: data
  })
}

// 删除家教广场
export function delSquare(requestId) {
  return request({
    url: '/square/square/' + requestId,
    method: 'delete'
  })
}
